package lab02.test34;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        List<String> List =new ArrayList<String>();
        List.add("apple");
        List.add("grape");
        List.add("banana");
        List.add("pear");
        Object[] a= List.toArray();

        System.out.println("the min is:"+a[0]);
        System.out.println("the max is:"+a[a.length-1]);

        //将集合进行排序，并将排序后的结果打印在控制台上
        System.out.println("After sorted:"+List);
        for(Object o:a){
            System.out.println(o);
        }
    }
}
